package net.yla.smartbus.module.ba.right.roles.mapper;

import net.yla.smartbus.module.ba.right.roles.entity.RolesDO;
import net.yla.smartbus.module.ba.right.roles.form.RolesForm;
import net.yla.smartbus.module.ba.right.right.query.QueryOfActual;
import net.yla.smartbus.module.ba.right.roles.query.QueryOfCount;
import net.yla.smartbus.module.ba.right.roles.query.QueryOfRoles;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Date: 2020-08-19 17:28
 * @Author: Being Nobody
 * @Version: 1.0
 */
public interface RolesMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(RolesDO record);

    int insertSelective(RolesDO record);

    RolesDO selectByPrimaryKey(Integer roleId);

    int updateByPrimaryKeySelective(RolesDO record);

    int updateByPrimaryKey(RolesDO record);

    List<RolesDO> roles(Integer adminId);

    int selectByName(QueryOfCount queryOfCount);

    RolesDO name(String roleName);


    List<RolesDO> selectByQuery(QueryOfRoles queryOfRoles);

    int updateForm(RolesForm rolesForm);

    int insertForm(RolesForm rolesForm);

    RolesDO role(Integer id, String name);

    //绑定admin
    List<RolesDO> selectByAdmin(QueryOfRoles queryOfRoles);

    /**
     * 查询菜单
     * @param href
     * @param type
     * @return
     */
    Integer selectMenuId(@Param("href") String href, @Param("type") Integer type);

    /**
     * 查询账号角色
     * @param admin
     * @return
     */
    Integer selectUserRoleId(@Param("admin") Integer admin);

    /**
     * 查询用户是否有权限
     * @param roleId
     * @param objectId
     * @return
     */
    int selectRoleMenuId(@Param("roleId") Integer roleId ,@Param("objectId") Integer objectId);



}
